package com.un.ebs.sys.domain;

import com.un.ebs.core.enums.DataTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;


/**
 * Field属性dto
 *
 * @Author lcl
 * @Date 2021/01/20
 */
@Data
@ApiModel(value = "Field", description = "表字段属性对象")
public class Field {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "字段名", name = "filedName")
    @NotNull(message = "字段名不能为空")
    private String filedName;

    @ApiModelProperty(value = "字段类型", name = "filedType")
    @NotNull(message = "字段类型不能为空")
    private DataTypeEnum filedType;

    @ApiModelProperty(value = "字段长度", name = "filedLength")
    private int filedLength;

    @ApiModelProperty(value = "字段精度(小数点几位)，默认为4", name = "filedAccuracy")
    private int filedAccuracy = 4;

    @ApiModelProperty(value = "是否为空(false：不为空,true:为空  )", name = "isNull")
    private boolean isNull;

    @ApiModelProperty(value = "是否主键（false：不为主键  true：为主键）", name = "isPk")
    private boolean isPk;

    @ApiModelProperty(value = "外键表名", name = "fkTableName")
    private String fkTableName;

    @ApiModelProperty(value = "外键字段名", name = "fkFieldName")
    private String fkFieldName;

    @ApiModelProperty(value = "序号", name = "sort")
    private int sort;
}
